package com.qianye.service.impl;


import com.qianye.pojo.entity.ConversationContent;
import com.qianye.service.ConversationContentBizService;
import com.qianye.service.ConversationContentCoreService;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * (ConversationContent)表服务实现类
 *
 * @author makejava
 * @since 2024-09-16 23:45:47
 */
@Service("conversationContentBizService")
public class ConversationContentBizServiceImpl implements ConversationContentBizService {
    @Resource
    private ConversationContentCoreService conversationContentCoreService;

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Override
    public ConversationContent queryById(Long id) {
        return this.conversationContentCoreService.queryById(id);
    }

    /**
     * 分页查询
     *
     * @param conversationContent 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */
    @Override
    public Page<ConversationContent> queryByPage(ConversationContent conversationContent, PageRequest pageRequest) {
        return this.conversationContentCoreService.queryByPage(conversationContent, pageRequest);
    }

    /**
     * 新增数据
     *
     * @param conversationContent 实例对象
     * @return 实例对象
     */
    @Override
    public ConversationContent insert(ConversationContent conversationContent) {
        this.conversationContentCoreService.insert(conversationContent);
        return conversationContent;
    }

    /**
     * 修改数据
     *
     * @param conversationContent 实例对象
     * @return 实例对象
     */
    @Override
    public ConversationContent update(ConversationContent conversationContent) {
        this.conversationContentCoreService.update(conversationContent);
        return this.queryById(conversationContent.getId());
    }

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    @Override
    public boolean deleteById(Long id) {
        return this.conversationContentCoreService.deleteById(id);
    }
}
